#include "Camera.h"
#include <math.h>
#ifndef PI
#define PI 3.1415926535897932
#endif // !PI
Camera::Camera(std::vector<float>_position, std::string _name) :GameObject(_position, _name)
{
	m_isVisible = false;
}
DirectX::XMMATRIX Camera::Render()
{
	DirectX::XMFLOAT3 directXUp, eyePosition;
	directXUp.x = 0.0f;
	directXUp.y = 1.0f;
	directXUp.z = 0.0f;
	
	eyePosition = m_transform->GetPosition();
	DirectX::XMFLOAT3 focusPosition = DirectX::XMFLOAT3(10.0f, 0.0f, 0.0f);
	DirectX::XMVECTOR focusPositionVector = DirectX::XMLoadFloat3(&focusPosition);
	focusPositionVector=DirectX::XMVector3Transform(focusPositionVector, m_transform->GetWorldMatrix());
	DirectX::XMMATRIX viewMatrix = DirectX::XMMatrixLookAtLH(DirectX::XMLoadFloat3(&eyePosition), focusPositionVector, DirectX::XMLoadFloat3(&directXUp));
	return viewMatrix;
}
